<template>
  <div class="city" @click="$router.push({ path:'/address' ,query:{city:city }})">
    <i class="fa fa-map-marker"></i>
    <span class="title">{{ address }}</span>
    <i class="fa fa-sort-desc"></i>
  </div>
</template>

<script>
export default {
  name:"Position",
  computed: {
    address(){
       return this.$store.getters.address;
    },
    city(){
     return this.$store.getters.location.addressComponent.city || this.$store.getters.location.addressComponent.province
    }
  }, 
};
</script>

<style scoped>
.city {
  color: #fff;
  height: 40px;
  width: 100%;
  display: flex;
  align-items: center;
  background-color: #009eef;
  padding: 0 20px;
}
.title {
  width: 80%;
  margin: 0 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
</style>